home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 2
/
Gold Medal Software Volume 2 (Gold Medal) (1994).iso
/
windows
/
comms
/
recomm10.arj
/
RECOMNET.H
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-12
|
3KB
|
173 lines
#ifdef CFILES
#include <windows.h>
#include <commdlg.h>
#include <stdio.h>
#include <string.h>
#include <toolhelp.h>
#include <string.h>
#include <wnetbios.h>
#endif
#ifdef MAIN
#define EXTVAR
#else
#define EXTVAR extern
#endif
#define APPNAME "RE_COM_CTRL"
#define SRVNAME "ReCommSrv"
#define APPINI "recomm.ini"
#define APPTITLE "RemoteCommPort"
#define INICOM 1
#define SETCOM 2
#define SETQUE 3
#define RECCOM 4
#define SNDCOM 5
#define CTX 6
#define TRMCOM 7
#define STACOM 8
#define CEXTFCN 9
#define CFLUSH 10
#define CEVT 11
#define CEVTGET 12
#define CSETBRK 13
#define CCLRBRK 14
#define GETDCB 15
#define CWSTRING 16
#define CRSTRING 17
#define ENABLENOTI 18
#define GETMASK 19
#define CONNECT 20
#define IDD_ABOUT 2000
#define IDD_BREAK 2001
#define IDD_LISTE 1000
#define IDD_TIMER 1001
EXTVAR char szAppName[30];
EXTVAR HANDLE hInstance;
EXTVAR HWND HwnD;
EXTVAR LPNCB lpNCB;
typedef struct {
char far *pqRx; /* pointer to Rx queue */
int cbqRx; /* size of Rx queue in bytes */
char far *pqTx; /* pointer to Tx queue */
int cbqTx; /* size of Tx queue in bytes */
} QDB;
typedef struct {
HWND hwnd;
WORD inTrig;
WORD outTrig;
} NOTI;
typedef struct {
WORD eword;
WORD stat;
} EVN;
union datarec {
DCB dcb;
QDB qdb;
COMSTAT cs;
NOTI noti;
EVN ev;
char txt[4096];
int x;
};
struct recComData { short len;
short fnc;
long rc;
int evmask;
union datarec a;
} comData;
struct recFindSrv {
BOOL stat;
char name[50];
} fndSrv;
char cmd[][10] = { "CONNECT",
"INICOM",
"SETCOM",
"SETQUE",
"RECCOM",
"SNDCOM",
"CTX",
"TRMCOM",
"STACOM",
"CEXTFCN",
"CFLUSH",
"CEVT",
"CEVTGET",
"CSETBRK",
"CCLRBRK",
"GETDCB",
"CWSTRING",
"CRSTRING",
"ENABLENOT",
"GETMASK",
"UNKWON" };
#define SC (sizeof(comData) - sizeof(comData.a) +1)
int cmdsize[] = { SC, // CONNECT
SC + sizeof(comData.a.dcb), // INICOM
SC + sizeof(comData.a.dcb), // SETCOM
SC + sizeof(comData.a.qdb), // SETQUE
SC, // RECCOM
SC + sizeof(comData.a.x), // SNDCOM
SC + sizeof(comData.a.x), // CTX
SC, // TRMCOM
SC + sizeof(comData.a.cs), // STACOM
SC + sizeof(comData.a.x), // CEXTFCN
SC + sizeof(comData.a.x), // CFLUSH
SC + sizeof(comData.a.x), // CEVT
SC + sizeof(comData.a.x), // CEVTGET
SC, // CSETBRK
SC, // CCLRBRK
SC + sizeof(comData.a.dcb), // GETDCB
SC, // CWSTRING Σndert sich
SC, // CRSTRING
SC + sizeof(comData.a.noti), // ENABLENOTI
SC, // GETMASK
SC };
int REMOTE_COM = 3;
unsigned long poll = 5000;
unsigned long tick, tack, evtick;
BOOL CONECTED = FALSE;
BOOL INTRANS = FALSE;
int event = 0;
NOTI noti;
extern HINSTANCE hLibrary;
//
// FUNCTION PROTOYPES
//
//
int readAnswer();
int analizeMessage();
int sendCMD();
int sendDgram();
void exitDll();